/*
 * Window.h
 */
#ifndef _WINDOW_H_
#define _WINDOW_H_

#include <allegro.h>
#include <string>

#include "defs.h"
#include "Container.h"
#include "GraphicContext.h"

namespace gui
  {
    class ComponentManager;

    class Window : public Container
      {
        int static _titleBarHeight;

        int _previouseMouseB;
        int _xOffset, _yOffset;

        bool _moveable;

        std::string _title;

        void checkDragging();
        void paintBorder(BITMAP* buffer, int x_offset, int y_offset);

      protected:
        GraphicContext _bgGc;
        GraphicContext _fgGc;
        GraphicContext _borderGc;

      public:
        Window();

        virtual void process();
        virtual void init();

        virtual GraphicContext& bgGc();
        virtual GraphicContext& fgGc();
        virtual GraphicContext& borderGc();

        virtual void paint(BITMAP* buffer, int x_offset, int y_offset);

        virtual bool const& moveable() const;
        virtual bool const& moveable(bool b);

        virtual std::string const& title() const;
        virtual std::string const& title(std::string title);
      };

  }

#endif
